package pay;

/**
 * 满减优惠策略.
 *
 * @author GongXincheng
 * @since 2019-09-14 13:59
 */
public class StraregyManJian implements Strategy {

    private double manJianPrice;
    private double jianPrice;

    public StraregyManJian(double manJianPrice, double jianPrice) {
        this.manJianPrice = manJianPrice;
        this.jianPrice = jianPrice;
    }

    @Override
    public double getResultPrice(double totalPrice) {
        if (totalPrice >= manJianPrice) {
            return totalPrice - jianPrice;

        }
        return totalPrice;
    }
}
